<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="modal-dialog x-modal-dialog">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
      </button>
      <h4 class="modal-title">编辑封面</h4>
    </div>
    <form class="form-horizontal ms-form form-personal-info" method="POST" action="${ctx.host}/bets/${betId}/edit-cover" data-validate="true">
      
      <input type="hidden" name="_method" value="PATCH">
      <input type="hidden" id="cover" name="mediaId" value="${bet.cover}">
      
      <div class="modal-body">
        <div class="form-group">
          <div class="upload-cover" style="width: 450px; height: 270px; margin: 0 auto;">
            <button type="button" id="pickCover" class="edit-btn fade"><span class='glyphicon glyphicon-repeat' aria-hidden='true'></span>&nbsp;&nbsp;重新上传</button>
            <div id="coverPreviewList">
              <c:if test="${not empty bet.cover}">
                <img id="coverPreview" src="${cloud.prod}/${bet.cover}-0.6"/>
              </c:if>
              <c:if test="${empty bet.cover}">
                <img id="coverPreview" src="" />
              </c:if>
            </div>
            <label id="messageCover" class="control-label messageCover hide"></label>
          </div>
        </div>
       <!-- <div class="form-group">
          <div id="videoPlayer" style="width: 100%; height: 300px;">
            
          </div>
        </div>
      </div>-->
      <div class="modal-footer x-modal-footer">
        <button type="submit" class="btn x-btn btn-primary">确定</button>
        <button type="button" class="btn x-btn x-btn-gary" data-dismiss="modal">取消</button>
      </div>
    </form>
  </div>

</div>